<template>
  <div class="wrapper"  @touchstart="jump">
    <div class="ring-bg"></div>
    <div class="ring-header">
      <div class="maximize-button">
        <img src="../assets/ami.png" style="color: #fff;width: 55px;">
      </div>
      <div class="ring-caller">
        <img src="../assets/agr.png" class="caller-avatar">
        <div class="ring-caller-title">周岩</div>
        <div class="ring-caller-caption">邀请你语音通话</div>
      </div>
      <!--<div class="ring-footer">-->
        <!--<img src="../assets/agw.png" id="call-refuse">-->
        <!--<img src="../assets/agf.png" id="call-receive">-->
      <!--</div>-->

    </div>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      selected: 'tab1',
      audio: require('../assets/8521.mp3'),
      clicked: false
    }
  },
  methods: {

  },
  mounted () {
    this.play()
  },
  watch: {
    '$route': {
      deep: true,
      handler () {
        this.play()
        console.log('xxx')
      }
    },
    selected: function (val, oldVal) {
      console.log(val)
      switch (val) {
        case 'tab1':
          this.$router.push('/mainpage')
          break
        case 'tab2':
          this.$router.push('/connected')
          break
      }
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.wrapper {
  height: 100%;
  margin: 0;
  padding: 0;
}
.ring-header {
  position: absolute;
  background: rgba(0, 0, 0, .8);
  z-index:-1;
  width:100%;
  height:100%;
  top:0px;
  left:0px;
}

.ring-bg {
  background-image: url('../assets/agr.png');
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: -1;
  background-size: 100% auto;
  transform: translate3d(0, 4rem, 0);
}

.maximize-button {
  position: absolute;
  margin-left: .266667rem;
  top: 1.24rem;
  left: .51rem;
  height: 1.92rem;
  padding-right: .2rem;
}
.ring-caller {
  position: absolute;
  top: 12.24rem;
  left: calc(50% - 54px);
}
.ring-caller-title {
  text-align: center;
  margin-top: 12px;
  font-size: 1.5rem;
  color: #fff;
}
.ring-caller-caption {
  text-align: center;
  margin-top: 10px;
  font-size: .65rem;
  color: #fff;
}
.caller-avatar {
  border-radius: 8px;
}
.ring-footer {
  position: fixed;
  bottom: 5rem;
}
.ring-footer #call-refuse {
  width: 4rem;
  float: left;
  left: 3.3rem;
}
.ring-footer #call-receive {
  width: 4rem;
  float: right;
  right: 3.3rem;
}
</style>
